import request from '@/utils/request'

// 查询爬虫管理列表
export function querySpiderConfig(query) {
  return request({
    url: '/spider/spiderConfig/list',
    method: 'post',
    params: query
  })
}

// 新增爬虫管理
export function addSpiderConfig(data) {
  return request({
    url: '/spider/spiderConfig/add',
    method: 'post',
    params: data
  })
}

// 修改爬虫管理
export function updateSpiderConfig(data) {
  return request({
    url: '/spider/spiderConfig/edit',
    method: 'post',
    params: data
  })
}

// 删除爬虫管理
export function delSpiderConfig(id) {
  let params  = Object.assign({}, {ids: id})
  return request({
    url: '/spider/spiderConfig/remove',
    method: 'post',
    params: params
  })
}

// 导出爬虫管理
export function exportSpiderConfig(query) {
  return request({
    url: '/spider/spiderConfig/export',
    method: 'post',
    params: query
  })
}

// ========================================================

// 查询爬虫字段列表
export function querySpiderField(query) {
  return request({
    url: '/spider/spiderField/list',
    method: 'post',
    params: query
  })
}

// 删除爬虫字段
export function delSpiderField(id) {
  let params  = Object.assign({}, {ids: id})
  return request({
    url: '/spider/spiderField/remove',
    method: 'post',
    params: params
  })
}

// 新增爬虫字段
export function addSpiderField(data) {
  return request({
    url: '/spider/spiderField/add',
    method: 'post',
    params: data
  })
}

// 修改爬虫字段
export function updateSpiderField(data) {
  return request({
    url: '/spider/spiderField/edit',
    method: 'post',
    params: data
  })
}

// ========================================================

// 查询爬虫字段规则
export function queryFieldRule(query) {
  return request({
    url: '/spider/fieldRule/list',
    method: 'post',
    params: query
  })
}

// 删除爬虫规则
export function delFieldRule(id) {
  let params  = Object.assign({}, {ids: id})
  return request({
    url: '/spider/fieldRule/remove',
    method: 'post',
    params: params
  })
}

// 新增爬虫规则
export function addFieldRule(data) {
  return request({
    url: '/spider/fieldRule/add',
    method: 'post',
    params: data
  })
}

// 修改爬虫规则
export function updateFieldRule(data) {
  return request({
    url: '/spider/fieldRule/edit',
    method: 'post',
    params: data
  })
}



